package com.d0312;

import java.util.Scanner;

public class Circular {
    float radius;
    final float PI = 3.14f;
    Circular(float r)
    {
        this.radius = r;
    }
    float area()
    {
        return PI*radius*radius;
    }
    float length()
    {
        return PI*radius*2;
    }

    public static void main(String[] args) {
        /*System.out.println("请输入一个圆的半径");
        Scanner sc = new Scanner(System.in);
        float r = sc.nextFloat();
        if(r<0)
        {
            System.out.println("输入有误");
        }*/
        Circular rec = new Circular(3.0f);
        System.out.println("面积"+rec.area());
        System.out.println("周长"+rec.length());
    }
}